1. Field of the Invention
This invention relates to an image processing having image scaling capability.
2. Description of the Related Art
Image processing systems may be required to effect image reduction processing and enlargement processing for scaling images to desired sizes. FIGS. 16(A)-16(D) are diagrams for explaining the nature of conventional vertical image reduction processing. In the original image shown in FIG. 16(A), image lines numbered 1, 4 and 7 are filled in black and the other lines are white. The reduced image shown in FIG. 16(B) is 0.8 time smaller than the original image.
In the reduced image shown in FIG. 16(B), the lines numbered 1 and 6 of the original image have been dropped and the reduced image is therefore missing one black horizontal line. As can be seen from this example, conventional vertical image reduction processing simply drops a number of lines. Fine line details are therefore sometimes lost. In the reduction of an original image having lines L1-L3 each having a width of one line as shown in FIG. 16(C), for example, the original line L3 may be dropped and completely lost after the image reduction as shown in FIG. 16(D). This problem of line dropping also arises during horizontal reduction.
FIGS. 17(A) and 17(B) are diagrams for explaining the nature of conventional vertical image enlargement processing. The original image shown in FIG. 17(A) is the same as that shown in FIG. 16(A) referred to above. The enlarged image shown in FIG. 17(B) is 1.25 times large than the original image. The image of FIG. 17(B) additionally includes the lines numbered 0 and 4 of the original image. The width of these lines is therefore doubled. As can be seen from this example, conventional vertical image enlargement processing simply adds a number of lines. The thickness of the lines in the image therefore becomes excessively thick. This problem of line addition also arises during horizontal enlargement.
Moreover, the conventional enlargement processing can easily enlarge an image an integer number of times but has difficulty enlarging an image by an arbitrary scale factor including a fractional component.
Accordingly, an object of the present invention is to mitigate image line dropping during reduction and image line thickening during enlargement. Another object of the present invention is to enable an image to be enlarged by an arbitrary scale factor which may include a fractional component.
In order to attain a least part of the above and other objects of the present invention, there is provided an image processing apparatus comprising a frame memory for storing image data, a vertical reduction unit, and a horizontal reduction unit. The vertical reduction unit reduces an image represented by the image data in the vertical direction when the image data are written to the frame memory, detects a first line which is to be dropped by the reduction, and interpolates a plurality of lines of the image data including the first line and a second line adjacent to the first line to modify an image portion of the second line. The horizontal reduction unit reduces the image represented by the image data in the horizontal direction, detects a first pixel which is to be dropped by the reduction, and interpolates a plurality of pixels of the image data including the first pixel and a second pixel adjacent to the first pixel to modify an image portion of the second pixel.
The vertical reduction unit can detect a first line which is to be dropped by the reduction and prevent total loss of line information at the time of reduction. Since lines not adjacent to those lines which are to be dropped by reduction are not processed by interpolation, image quality degradation owing to the line dropping can be mitigated without appreciably degrading the sharpness of the image. Similarly in horizontal reduction, simple dropping of a pixel during reduction can be prevented and image quality degradation owing to pixel dropping can be mitigated without appreciably degrading the sharpness of the image.
In a preferred embodiment, each of the vertical reduction unit and the horizontal reduction unit comprises: a buffer memory for storing a prescribed amount of input image data; a weighted-averaging unit for obtaining a weighted-average of first image data read from the buffer memory and second image data representing an image portion immediately following the first image data to produce third image data; a selector for selecting and outputting one set from among a plurality of sets of image data including the input second image data and the third image data output by the weighted-averaging unit; and a selection signal generator for generating from an image reduction factor a selection signal indicating an image portion which is to be dropped by the reduction and supplying the selection signal to the selector.
In these reduction units, since one set from among plural sets of image data including the input second image data and the third image data generated by the weighted-averaging unit is selected and output, image data with mitigated dropout during reduction can be generated in real time.
The apparatus may further comprise a write address controller responsive to the selection signal for controlling incrementing of a write address input to the frame memory. By this, image data with mitigated dropout during reduction can be written to an apparatus address in the frame memory.
Preferably, the vertical reduction unit and the horizontal reduction unit each has a reduction factor in the range of 0.5 to 1, whereby the image portion which is to be dropped by the reduction in the vertical reduction unit is one line per location and the image portion which is to be dropped by the reduction in the horizontal reduction unit is one pixel per location.
According to another aspect of the present invention, an image processing apparatus comprises: a frame memory for storing image data; a vertical enlargement unit for enlarging an image represented by the image data read from the frame memory in the vertical direction, detecting the first line which is to be added by the enlargement, and interpolating a plurality of lines of the image data adjacent to the first line to generate image data for the first line, and a horizontal enlargement unit for enlarging an image represented by the image data in the horizontal direction, detecting a first pixel which is to be added by the enlargement, and interpolating a plurality of pixels of the image data adjacent to the first pixel to generate image data for the first pixel.
The vertical enlargement unit can, at the time a first line is added by the enlargement, generate the first line by interpolation of image data of plural lines including the first line and a second line adjacent to the first line. Thickening of a line due to simple addition of the same line during enlargement can therefore be prevented. Since the interpolation is not executed with respect to those lines which are present in the original image, image quality degradation owing to line thickening can be mitigated without appreciably degrading the sharpness of the image. Similarly in horizontal enlargement, simple pixel thickening during enlargement can be prevented and image quality degradation owing to simple pixel addition can be mitigated without appreciably degrading the sharpness of the image.
In a preferred embodiment, each of the vertical enlargement unit and the horizontal enlargement unit comprises: a buffer memory for storing a prescribed amount of input image data; a weighted-averaging unit for obtaining a weighted-average of first image data read from the buffer memory and second image data representing an image portion immediately following the first image data to produce third image data; a selector for selecting and outputting one set from among a plurality of sets of image data including the input second image data and the third image data output by the weighted-averaging unit; and a selection signal generator for generating from an image enlargement factor a selection signal indicating an image portion which is to be added by the enlargement and supplying the selection signal to the selector.
In these enlargement units, since one set from among plural sets of image data including the input second image data and the third image data generated by the weighted-averaging unit is selected and output, image data with mitigated thickening during enlargement can be generated in real time.
The apparatus may further comprise a read address controller responsive to the selection signal for controlling incrementing of a read address input to the frame memory. By this, image data with mitigated dropout during enlargement can be read from an appropriate address in the frame memory.
Preferably, the vertical enlargement unit and the horizontal enlargement unit each has an enlargement factor in the range of 1 to 2, whereby the image portion which is to be added by the enlargement in the vertical enlargement unit is one line per location and the image portion which is to be added by the enlargement in the horizontal enlargement unit is one pixel per location.
According to still another aspect of the present invention, an image processing apparatus for enlarging an image comprises: a first enlargement unit for enlarging an image in by a first enlargement factor in the range of 1 to 2; and a second enlargement unit for enlarging an image by a second enlargement factor that is an integer; wherein the first and second enlargement units execute the enlarging of the image in a prescribed order to enlarge the image by a third enlargement factor equal to the product of the first and second enlargement factors.
Since image enlargement at the first enlargement factor which can include a fractional component and image enlargement at the second enlargement factor that is an integer are effected serially, the image can be enlarged by a desired enlargement factor which can include a fractional component.
Preferably, the first and second enlargement units execute the enlarging in this order; and the enlargement processing is executed such that the second enlargement unit outputs image data at a second output rate which is equal to a product of a first output rate of the first enlargement unit and the second enlargement factor. Since this enables the second enlargement section to sequentially enlarge the image data output by the first enlargement section without modification, it enables the enlargement to be effected at a high overall processing speed.
The present invention is also directed to an image processing method for executing the above image reduction and/or the image enlargement processing.
These and other objects, features, aspects, and advantages of the present invention will become more apparent from the following detailed description of the preferred embodiments with the accompanying drawings.